<?php
/**
 * This file defines the {@see \BF\Config\IReader} interface.
 *
 * @author     Kado <ulfikado@gmail.com>
 * @category   Beluga PHP5.3+ Framework
 * @package    BF\Core
 * @since      2015-01-28 14:29
 * @subpackage Config
 * @version    0.1
 */

namespace BF\Config
{

   /**
    * If you want implement youre own configuration reader, you have to implement this interface.
    *
    * The reader must do read the config data from defined source. (e.g. files or databases)
    *
    * @since v0.1
    */
   interface IReader
   {

      /**
       * Reads the next defined config value from source and returns it as a {@see \BF\Config\Value},
       * or it returns (boolean)FALSE if the reading pointer comes to the end of the source.
       *
       * @return \BF\Config\Value or boolean FALSE
       */
      function read();

      /**
       * Reads all config values, beginning at current source pointer and returns it.
       *
       * @return \BF\Config\ValueCollection
       */
      function readAll();

      /**
       * Returns all current defined reader options as a associative array. The used options are depending to the
       * reader implementation.
       *
       * @return array
       */
      function getOptions();

      /**
       * Returns, if the current reader is opened.
       *
       * @return boolean
       */
      function isOpen();

      /**
       * Returns, if the current reader is opened and can be used for reading.
       *
       * @return boolean
       */
      function canRead();

      /**
       * Sets the reader position to the start of the reader.
       */
      function reset();

      /**
       * Relaods all data from based source.
       */
      function reload();

   }

}

